package com.i2works.smartluolong.web.config;

/**
 * @author Liu Yutao <koal@vip.qq.com>
 * @date 2018/3/13 15:53
 */
//@Configuration
public class SnakerConfiguration {

//    private final DataSource dataSource;
//
//    private final SqlSessionFactory sqlSessionFactory;
//
//    @Autowired
//    public SnakerConfiguration(DataSource dataSource, SqlSessionFactory sqlSessionFactory) {
//        this.dataSource = dataSource;
//        this.sqlSessionFactory = sqlSessionFactory;
//    }
//
//
//    /**
//     * 进度服务
//     */
//    @Bean("processService")
//    public ProcessService getProcessService(MemoryCacheManager cacheManager, MybatisAccess access) {
//        ProcessService processService = new ProcessService();
//        processService.setAccess(access);
//        processService.setCacheManager(cacheManager);
//        return processService;
//    }
//
//    /**
//     * 订单服务
//     */
//    @Bean("orderService")
//    public OrderService getOrderService(MemoryCacheManager cacheManager, MybatisAccess access) {
//        OrderService service = new OrderService();
//        service.setAccess(access);
//        return service;
//    }
//
//    /**
//     * 任务服务
//     */
//    @Bean("taskService")
//    public TaskService getTaskService(MemoryCacheManager cacheManager, MybatisAccess access) {
//        TaskService service = new TaskService();
//        service.setAccess(access);
//        return service;
//    }
//
//    /**
//     * 管理器服务
//     */
//    @Bean("managerService")
//    public ManagerService getManagerService(MemoryCacheManager cacheManager, MybatisAccess access) {
//        ManagerService service = new ManagerService();
//        service.setAccess(access);
//        return service;
//    }
//
//    /**
//     *  查询服务
//     */
//    @Bean("queryService")
//    public QueryService getQueryService(MemoryCacheManager cacheManager, MybatisAccess access) {
//        QueryService service = new QueryService();
//        service.setAccess(access);
//        return service;
//    }
//
//    /**
//     * spring管理snaker引擎
//     */
//    @Bean
//    public SpringSnakerEngine getSpringSnakerEngine(ProcessService processService, OrderService orderService, TaskService taskService, QueryService queryService, ManagerService managerService) {
//        SpringSnakerEngine engine = new SpringSnakerEngine();
//        engine.setProcessService(processService);
//        engine.setOrderService(orderService);
//        engine.setTaskService(taskService);
//        engine.setQueryService(queryService);
//        engine.setManagerService(managerService);
//        return engine;
//    }
//
//    /**
//     * 数据库配置
//     */
//    @Bean("dbAccess")
//    public MybatisAccess getMybatisAccess() {
//        MybatisAccess access = new MybatisAccess();
//        access.setSqlSessionFactory(sqlSessionFactory);
//        access.setDataSource(dataSource);
//        return access;
//    }
//
//    @Bean("lobHandler")
//    public DefaultLobHandler getDefaultLobHandler() {
//        return new DefaultLobHandler();
//    }
//
//    /**
//     * 缓存
//     */
//    @Bean("cacheManager")
//    public MemoryCacheManager getMemoryCacheManager() {
//        return new MemoryCacheManager();
//    }
//
//    @Bean
//    public LogInterceptor getLogInterceptor() {
//        return new LogInterceptor();
//    }
//
//    @Bean
//    public SpelExpression getSpelExpression() {
//        return new SpelExpression();
//    }
//
//    @Bean
//    public SurrogateInterceptor getSurrogateInterceptor() {
//        return new SurrogateInterceptor();
//    }
//


}
